package com.xcfw.dorm.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Building {
    private Integer id;

    private String building;

    private Byte beginFloor;

    private Byte endFloor;

    private Byte beginRoom;

    private Byte endRoom;

    private String uuid;

    private Date updateTime;

    private Date createTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Building building1 = (Building) o;
        return Objects.equals(building, building1.building) &&
                Objects.equals(beginFloor, building1.beginFloor) &&
                Objects.equals(endFloor, building1.endFloor) &&
                Objects.equals(beginRoom, building1.beginRoom) &&
                Objects.equals(endRoom, building1.endRoom);
    }

    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), building, beginFloor, endFloor, beginRoom, endRoom);
    }
}